package com.hongfeng.support.item.exp;

import java.io.Serializable;

import com.hongfeng.support.item.tag.FieldOperator;
import com.hongfeng.support.item.tag.LogicOperator;
import com.hongfeng.support.item.tag.RelationOperator;

/**
 * 字段表达式
 * 
 * @author llc
 * 
 */
public class FieldExpression implements Serializable {

	private static final long serialVersionUID = 6477474048065575387L;

	private final String propertyName;// 属性名
	private final Object value;// 属性值
	private final FieldOperator fieldOperator; // 操作符
	private final LogicOperator logicOperator;// 逻辑运算符
	private final RelationOperator relationOperator;// 括弧运算符

	public FieldExpression(String propertyName, FieldOperator fieldOperator,
			Object value) {
		this.propertyName = propertyName;
		this.value = value;
		this.fieldOperator = fieldOperator;
		this.logicOperator = LogicOperator.AND;
		this.relationOperator = null;
	}

	public FieldExpression(String propertyName, FieldOperator fieldOperator,
			LogicOperator logicOperator, RelationOperator relationOperator,
			Object value) {
		this.propertyName = propertyName;
		this.value = value;
		this.fieldOperator = fieldOperator;
		this.logicOperator = logicOperator;
		this.relationOperator = relationOperator;
	}

	public String getPropertyName() {
		return propertyName;
	}

	public Object getValue() {
		return value;
	}

	public FieldOperator getFieldOperator() {
		return fieldOperator;
	}

	public LogicOperator getLogicOperator() {
		return logicOperator;
	}

	public RelationOperator getRelationOperator() {
		return relationOperator;
	}
}
